-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER TRIGGER [dbo].[trgONU] ON [dbo].[TT_RESOURCE_ONU]
   AFTER INSERT
AS 
declare @i int
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	set @i=1 
	while @i<25 
	begin 
		insert into TT_RESOURCE_ONU_PORT(N_ONU_ID,N_PORT,S_STATE)
		select N_ID ,@i,'0' from inserted
	set @i=@i+1 
	end

END